import axios from 'axios'


function post (obj) {
  return new Promise((resolve, reject) => {
    axios.post(obj.url, obj.data, {
      headers: { 'Content-Type': 'application/json;charset=UTF-8' }
    })
      .then(res => {
        resolve(res.data)
      })
      .catch(error => {
        reject(error)
      })
  })
}

const requests = {}
requests.post = post

export default requests
